package com.mttk.api.addon.ai.pool;

import com.mttk.api.addon.ai.pool.model.AiModel;
import com.mttk.api.addon.annotation.ServiceFlag;
import com.mttk.api.addon.annotation.ServiceFlag.SERVICE_TYPE;
import com.mttk.api.addon.annotation.ui.Control;
import com.mttk.api.addon.annotation.ui.Panel;
import com.mttk.api.addon.annotation.ui.Table;
import com.mttk.api.addon.impl.AbstractBasePoolService;
import com.mttk.api.addon.impl.AbstractNoAnnotationPoolService;
import com.mttk.api.addon.impl.pool.CustomizePooledObjectFactory;

//使用connection而不是resource是因为以后可能支持HTTP连接池
@ServiceFlag(key = "ai_model_pool", name = "AI模型", description = "", type = SERVICE_TYPE.POOL, i18n = "/com/mttk/api/addon/ai/i18n")
@Control(key = "provider", label = "提供者", mandatory = true, mode = "select", defaultVal = "ds", props = "options:ds:深度探索,silicon:掘金,common:通用")
@Control(key = "appKey", label = "API密钥", mandatory = true, props = "type:password")
@Control(key = "ext_props", size = 1, label = "额外参数",defaultVal="{}",description="值为JSON格式.\n为了支持模型的参数调整或支持其他AI提供者,可以使用额外参数解决.\n额外参数优先级比界面配置参数高.\n额外参数值为空字符串时时,会删除此参数设置,哪怕在界面上设置过.", props = { "type:multiple", "rows:5" })
public class AiPoolService extends AbstractNoAnnotationPoolService<AiModel> implements AiPoolDeepseek,AiPoolSilicon,AiPoolCommon{
	@Override
	public CustomizePooledObjectFactory<AiModel> getFactory() {
		return new AiPoolFactory();
	}
}
